
// 69.x的平方根
class Solution {
    typedef  unsigned long long ull;
public:
    int mySqrt(int x) {
        // 用二分解决
        ull l = 0 , r = sqrt(x) + 1;
        while(l + 1 < r)
        {
            ull mid = l + (r - l)/2;
            if(mid*mid > x) r = mid;
            else l = mid;
        }            
        return l;
    }
};